<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/page/share/taglib.jsp"%>
<%
	String root = request.getContextPath();
	response.setHeader("Cache-Control", "no-store"); //HTTP1.1
	response.setHeader("Pragma", "no-cache"); //HTTP1.0
	response.setDateHeader("Expires", 0);
%>
<form name="queryForm" id="queryForm"
	action="<%=request.getContextPath()%>/exception/shown!logShown.do"
	method="post">
	<input type="hidden" name="curPageNo" id="currentPgNoHid"
		value="<s:property value="curPageNo" />" />
</form>
<div id="queryListDiv">
	<div id="data">
		<h2 class="u-title">所以批次执行日志：</h2>
		<table class="datashow" style="width: 95%; table-layout: fixed;"
			cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th width="10%" class="table_head">批次号</th>
					<th width="8%" class="table_head">批次模式</th>
					<th width="10%" class="table_head">批量日期</th>
					<th width="15%" class="table_head">开始时间</th>
					<th width="15%" class="table_head">结束时间</th>
					<th width="8%" class="table_head">执行状态</th>
					<th width="20%" class="table_head">情况描述</th>
					<th width="20%" class="table_head">批次操作</th>
				</tr>
			</thead>
			<tbody>
				<s:if test="pageInfo.records.size > 0">
					<s:iterator value="pageInfo.records" var="log" status="status">
						<s:if test="#status.odd">
							<tr class="style1">
								<td><s:property value="#log.batchNo" /></td>
								<td><s:property value="#log.dbRunMode" /></td>
								<td><s:property value="#log.batchDate" /></td>
								<td><s:property value="#log.startTime" /></td>
								<td><s:property value="#log.endTime" /></td>

								<!-- 通过执行状态，给予可操作的功能 -->
								<s:if test='#log.status.toString() == "COMPLETED"'>
									<td><span class="run-success">成功</span></td>
								</s:if>
								<s:elseif test='#log.status.toString() == "STARTED"'>
									<td><span class="run-wait">准备开始</span></td>
								</s:elseif>
								<s:else>
									<td><span class="run-failed">失败</span></td>
								</s:else>
								<td><s:property value="#log.desc" /></td>
								<td class="txtCenter"><a href="#"
									onclick="findDetailShown('<s:property value="#log.id" />','<s:property value="#log.runningMode" />');">
										详细信息 </a></td>
							</tr>
						</s:if>
						<s:else>
							<tr class="style2">
								<td><s:property value="#log.batchNo" /></td>
								<td><s:property value="#log.dbRunMode" /></td>
								<td><s:property value="#log.batchDate" /></td>
								<td><s:property value="#log.startTime" /></td>
								<td><s:property value="#log.endTime" /></td>

								<!-- 通过执行状态，给予可操作的功能 -->
								<s:if test='#log.status.toString() == "COMPLETED"'>
									<td><span class="run-success">成功</span></td>
								</s:if>
								<s:elseif test='#log.status.toString() == "STARTED"'>
									<td><span class="run-wait">准备开始</span></td>
								</s:elseif>
								<s:else>
									<td><span class="run-failed">失败</span></td>
								</s:else>
								<td><s:property value="#log.desc" /></td>
								<td class="txtCenter"><a href="#"
									onclick="findDetailShown('<s:property value="#log.id" />','<s:property value="#log.runningMode" />');">
										详细信息 </a></td>
							</tr>
						</s:else>
					</s:iterator>
				</s:if>
				<s:else>
					<tr>
						<td><span style="color: blue">暂无记录！</span></td>
					</tr>
				</s:else>
			</tbody>
		</table>
		<table class="datashow" style="width: 95%; table-layout: fixed;"
			cellpadding="0" cellspacing="0">
			<tr>
				<td width="100%" align="center"><SPAN class="pagebanner">
						共<label id="allSize">${pageInfo.totalrecord}</label>条记录&nbsp;&nbsp;&nbsp;
						<label id="currentPage">${pageInfo.currentpage}</label>/<label
						id="allPages">${pageInfo.totalpage}</label>页 &nbsp;&nbsp;&nbsp; <input
						type="button" value="转至" onclick="myGotoPage(); " /> <input
						type="text" style="width: 45px; text-align: center;"
						id="changePageTo" name="changePageTo"
						value="${pageInfo.currentpage }"></input>页 &nbsp;&nbsp;&nbsp; <a
						href="#" onclick="myPrePage();"> <IMG
							src="<%=root%>/resources/images/btn_arrowback.jpg"></a>&nbsp; <a
						href="#" onclick="myNextPage();"> <IMG
							src="<%=root%>/resources/images/btn_arrowforward.jpg"></a>
				</SPAN> <%-- 返回处理 --%> <input type="hidden" name="backFlag"
					value="${backFlag}" id="backFlag" /></td>
			</tr>
		</table>
	</div>
	<div id ="detail"></div>
</div>



<<script type="text/javascript">
function findDetailShown(logIdVal,runningModeVal){
   var _ctx = "<%=root%>";
		var url = _ctx + "/exception/shown!detailShown.do";
		$.get(url, {
			logId : logIdVal,
			runningMode : runningModeVal
		}, function(data, textStatus) {
			$("#detail").html(data);
		});
		return url;
	}

</script>
	
	
	

	

